<?php
/**
 * 发送邮件的命令类
 * 
 * Class FeedbackCommand
 */
//class LoginCommand extends Command{
//class FeedbackCommand extends Command{　
/*class FeedbackCommand extends Command{
	function execute(CommandContext $context){　　
		$msgSystem = Registry::getMessageSystem();　　　　　
		$email = $context->get('email');
		$msg = $context->get('msg');\
		$topic = $context->get('topic');
		$result = $msgSystem->send($email,$msg,$topic);
		if(!$result){
			$context->setError($msgSystem->getError());
			return false;
		}
		return true;
	}
}*/

class FeedbackCommand extends Command{
	function execute(CommandContext $context){
		$msgSystem = Registry::getMessageSystem();
		
		$email = $context->get('email');
		$msg = $context->get('msg');
		$topic = $context->get('topic');

		$result = $msgSystem->send($email,$msg,$topic);
	
		if(! $result){
			$context->setError($msgSystem->getError());
			return false;
		}

		return true;
	}


}
